<script type="text/javascript" >
    stYoutubeToolbox.load_tooltip();
    stYoutubeToolbox.on_submitform('#videoForm', function(data){
        stYoutubeToolbox.loadPage('youtubeList', '', '<?php _e("Successful", $config['plugin_name']) ?>');
    });
    stYoutubeToolbox.loadRemoveButton();
</script>
<div class="w100p bgl">
    <div class="w100p bgr p5b">
        <form class="stform" id="videoForm" action="<?php echo admin_url('/admin.php?page=' . $config['plugin_name'] . '&action=' . $current_action) ?>" method="post" >
            <ul>
                <li>
                    <label><?php _e('Title', $config['plugin_name']); ?>:</label>
                    <div>                        
                        <input <?php echo $disable ?> value="<?php echo $result->title ?>" class="required" name="data[title]" id="title1" type="text"/>
                    </div>
                    <br clear="both" />
                </li>
                <li>
                    <label><?php _e('Category', $config['plugin_name']); ?>:</label>
                    <div>                        
                        <select <?php echo $disable ?> class="" name="data[category]">
                            <option <?php echo $result->category == 'Autos' ? 'selected' : '' ?> value="Autos">Autos &amp; Vehicles</option>
                            <option <?php echo $result->category == 'Comedy' ? 'selected' : '' ?> value="Comedy">Comedy</option>
                            <option <?php echo $result->category == 'Education' ? 'selected' : '' ?> value="Education">Education</option>
                            <option <?php echo $result->category == 'Entertainment' ? 'selected' : '' ?> value="Entertainment">Entertainment</option>
                            <option <?php echo $result->category == 'Film' ? 'selected' : '' ?> value="Film">Film &amp; Animation</option>
                            <option <?php echo $result->category == 'Games' ? 'selected' : '' ?> value="Games">Gaming</option>
                            <option <?php echo $result->category == 'Howto' ? 'selected' : '' ?> value="Howto">Howto &amp; Style</option>
                            <option <?php echo $result->category == 'Music' ? 'selected' : '' ?> value="Music">Music</option>
                            <option <?php echo $result->category == 'News' ? 'selected' : '' ?> value="News">News &amp; Politics</option>
                            <option <?php echo $result->category == 'Nonprofit' ? 'selected' : '' ?> value="Nonprofit">Nonprofits &amp; Activism</option>
                            <option <?php echo $result->category == 'People' ? 'selected' : '' ?> value="People">People &amp; Blogs</option>
                            <option <?php echo $result->category == 'Animals' ? 'selected' : '' ?> value="Animals">Pets &amp; Animals</option>
                            <option <?php echo $result->category == 'Tech' ? 'selected' : '' ?> value="Tech">Science &amp; Technology</option>
                            <option <?php echo $result->category == 'Sports' ? 'selected' : '' ?> value="Sports">Sports</option>
                            <option <?php echo $result->category == 'Travel' ? 'selected' : '' ?> value="Travel">Travel &amp; Events</option>
                        </select>
                    </div>
                    <br clear="both" />
                </li>
                <li>
                    <label><?php _e('Description', $config['plugin_name']); ?>:</label>
                    <div>                        
                        <textarea <?php echo $disable ?> id="description" name="data[description]" cols="5" rows="5"><?php echo $result->description ?></textarea>

                    </div>
                    <br clear="both" />
                </li>
                <li>
                    <label><?php _e('Tags', $config['plugin_name']); ?>:</label>
                    <div>                        
                        <textarea <?php echo $disable ?> id="tag" name="data[tag]" cols="5" rows="5"><?php echo str_replace('|*|', ' ', $result->tag) ?></textarea>
                    </div>
                    <br clear="both" />
                </li>

                <li>
                    <label><?php _e('Playlists & Favorite', $config['plugin_name']); ?>:</label>
                    <div class="playlist">
                        <div>
                            <input <?php echo $result->favorite == 1 ? 'checked' : '' ?> type="checkbox" value="1" name="data[favorite]" />
                            <label >Favorite</label>
                        </div>
                        <?php
                        $i = 2;
                        foreach ($playlists as $value) {
                            if (in_array($value->playlist_id, $video_playlist)) {
                                $check = 'checked';
                            } else {
                                $check = '';
                            }
                        ?>
                        <div>
                            <input <?php echo $check ?> type="checkbox" value="<?php echo $value->playlist_id ?>" name="data[playlist][]" />
                            <label><?php echo $value->name ?></label>
                        </div>
                            
                        <?php if ($i == 3) {?>
                                <br clear="both" />
                        <?php } ?>
                        <?php
                            $i++;
                        }
                        ?>
                    </div>
                    <br clear="both" />
                </li>
                <li><input type="submit" value="Submit"/></li>
            </ul>
            <input type="hidden" value="<?php echo $result->id ?>" id="id" name="data[id]"/>
            <input type="hidden" value="<?php echo $result->user_id ?>" id="user_id" name="data[user_id]"/>
            <input type="hidden" value="<?php echo $result->video_id ?>" id="id" name="data[video_id]"/>
            
        </form>
    </div>
</div>

